import unittest
import HTMLTestRunner
import os
import  time
print(os.path.abspath('report'))
report_path = os.path.abspath('report')

html_reprt_filename = time.strftime("%Y%m%d%H%M%S") + '-HTMLReport.html'
print(time.strftime("%Y%m%d%H%M%S") + '-HTMLReport.html')
hrml_report_path = os.path.join(report_path, html_reprt_filename)
print(hrml_report_path)
loader = unittest.defaultTestLoader.discover('test_cases', 'test*')
with open(hrml_report_path, 'wb') as f:
    runner = HTMLTestRunner.HTMLTestRunner(
        title='自动测试报告',
        description='报告描述',
        tester='朱梓鑫',
        stream=f,
        verbosity=2)
    runner.run(loader)


